/*
	FileName : app_uart6.h
	Description : 

		UART6 is used as RS485 device to communicate with HOST.

	Created on 2013.10.11 by ZZP.


	Revision History:


*/

#ifndef __APP_SPI2__
#define __APP_SPI2__

#include "includes.h"
#include <stm32f2xx.h>

#define AppTaskSPI2_CYCLE	10
#define AppTaskSPI2_LEAST_COUNT_EACH_SEC  1
void  AppTaskSPI2 (void *p_arg);
uint8_t AppTaskSPI2_ERR(uint8_t sec);


//-------------------- Application ------------------------------------------------------
#define FRAMENUM		32		//should <0x100
#define FRAMEDATALEN	1024


typedef struct{
    uint8_t 	socketIndex;	//=0;1;2;3;4;5;6;7;
	uint8_t		socketMode;		//1:TCP		2:UDP
	
	uint16_t	netDataLen;
    uint8_t 	netData[FRAMEDATALEN];
	
}NET_FRAME, *pNET_FRAME;


extern uint8_t	SOCKET_DEBUG_STR_EN;
extern void w5500SendFrame(uint8_t socket,uint8_t* buf,uint16_t len);
extern void w5500SendFrameStr(uint8_t socket,char mes[],uint8_t *buf,uint16_t len);
extern void w5500ReadFrame(uint8_t* buf,uint16_t* len);



#endif
//EOF





